<?php
/* Smarty version 4.5.5, created on 2025-04-29 22:26:40
  from 'E:\server\product1\myapp\app\view\product\daycontrol\add.html' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.5',
  'unifunc' => 'content_6810e1a0ee80b8_38518748',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '4050e0c9541ddd97de0ded2c253b8ed507f4fb60' => 
    array (
      0 => 'E:\\server\\product1\\myapp\\app\\view\\product\\daycontrol\\add.html',
      1 => 1728706100,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_6810e1a0ee80b8_38518748 (Smarty_Internal_Template $_smarty_tpl) {
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['index']['title'];?>
</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/lay/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/lay/layui/index.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
        <form name="addItem" method="post" lay-filter="component-form-group" class="layui-form">
          <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['id'];?>
" name="id">
          <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['aid'];?>
" name="aid">
          <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['relate'];?>
" name="relate">
            
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['name'];?>
</label>
              <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="title" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['title'];?>
" >
              </div>
            </div>
            <div class="layui-inline">
                  <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</label>
                  <div class="layui-input-block">
                      <select name="proid" lay-verify="proid" lay-filter="brickType">
                         <option value="0"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
</option>
                         <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pro']->value, 'item');
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
                         <option data-proname="<?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['proid'] == $_smarty_tpl->tpl_vars['item']->value['id']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
</option>
                         <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                      </select>
                  </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['fixed'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['money'];?>
</label>
              <div class="layui-input-block">
                <input type="text" name="fixmoney" class="layui-input" lay-verify="fixmoney" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['fixmoney'];?>
" >
              </div>
            </div>
            <div class="layui-inline" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['timetype'] == 1) {?>style="display: none"<?php }?>>
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['fixed'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['time'];?>
</label>
              <div class="layui-input-block">
                <input type="text" name="fixtime" class="layui-input" lay-verify="fixtime" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['fixtime'];?>
" >
              </div>
            </div>
            <?php if ($_smarty_tpl->tpl_vars['grade']->value == 'superadmin') {?>
            <div class="layui-inline">
            <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['gorun'];?>
</label>
            <div class="layui-input-block">
              <input type="radio" name="auto" lay-filter="brickType" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['auto'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['auto'] == 1) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="auto" lay-filter="brickType" value="2" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['noauto'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['auto'] == 2) {?> checked<?php }?>>
            </div>
            </div>
            <?php } else { ?>
                <input type="hidden" name="auto" class="layui-input" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['auto'];?>
" >
            <?php }?>
          </div>

          <div class="layui-form-item">
            <?php if ($_smarty_tpl->tpl_vars['grade']->value == 'superadmin') {?>
            <div class="layui-inline">
                <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['agent'];?>
</label>
                <div class="layui-input-inline">
                  <input type="text" name="username" class="layui-input" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['username'];?>
" >
                </div>
                <button class="layui-btn" id="checkuser" type="button"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['agent'];?>
</button>
            </div>
            <?php } else { ?>
                <input type="hidden" name="username" class="layui-input" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['username'];?>
" >
            <?php }?>

            <div class="layui-inline yunying" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['auto'] == 2) {?>style="display: none;"<?php }?>>
                <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['regula'];?>
</label>
                <div class="layui-input-inline">
                  <input type="text" name="relatename" class="layui-input" value="<?php echo $_smarty_tpl->tpl_vars['datainfo']->value['relatename'];?>
" >
                </div>
                <button class="layui-btn" id="checkoper" type="button"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['regula'];?>
</button>
            </div>
          </div>

            <div class="layui-form-item">
              <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['notes'];?>
</label>
              <div class="layui-input-block" style="width:80%;">
                <textarea  id="demo" name="description" lay-verify="description" placeholder="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['pinput'];?>
" class="layui-textarea"><?php echo $_smarty_tpl->tpl_vars['datainfo']->value['description'];?>
</textarea>
              </div>
            </div>

            <div class="layui-form-item">
            <label class="layui-form-label"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['status'];?>
</label>
            <div class="layui-input-block">
              <input type="radio" name="status" value="0" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['unpublish'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['status'] == 0) {?> checked<?php }?>  >&nbsp;&nbsp;<input type="radio" name="status" value="1" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['publish'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['status'] == 1) {?> checked<?php }?>>&nbsp;&nbsp;<input type="radio" name="status" value="2" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['finish'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['status'] == 2) {?> checked<?php }?>>&nbsp;&nbsp;<input type="radio" name="status" value="3" title="<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['close'];?>
" <?php if ($_smarty_tpl->tpl_vars['datainfo']->value['status'] == 3) {?> checked<?php }?>>
            </div>
            </div>
                  
          <div class="layui-form-item layui-layout-admin">
            <div>
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" type="button" id="submit" lay-submit lay-filter="submit"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['submit'];?>
</button>
                <button type="reset" id="reset" class="layui-btn layui-btn-primary"><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['reset'];?>
</button>
                <button type="button" class="layui-btn layui-btn-primary" onClick="xadmin.close();" ><?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['back'];?>
</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
<?php echo '<script'; ?>
 src="/static/lay/layui/layui.js"><?php echo '</script'; ?>
>
  <?php echo '<script'; ?>
 type="text/javascript">
    layui.config({
     base: '/static/lay/' //静态资源所在路径
   }).extend({
     xadmin: 'lib/xadmin' //弹窗
   }).use(['jquery', 'layer','xadmin', 'form', 'element','layedit','laydate'], function(){
    var $ = layui.$ //引用jq
    var layer = layui.layer; //独立版的layer无需执行这一句
    var form = layui.form;
     form.render(null, 'component-form-group');
        var layedit = layui.layedit;
        layedit.set({
            uploadImage: {
                 url: '/content/common/editor_upload_img/'
                ,type: 'post' //默认post
            }
        });
        description=layedit.build('demo',{tool: [
            'strong' //加粗
            ,'italic' //斜体
            ,'underline' //下划线
            ,'del' //删除线
            ,'|' //分割线
            ,'left' //左对齐
            ,'center' //居中对齐
            ,'right' //右对齐
            ,'link' //超链接
            ,'unlink' //清除链接
            ,'face' //表情
            ,'image' //插入图片
            ,'code'
            ,'help' //帮助
        ]}); //建立编辑器

        layui.laydate.render({
          type: 'datetime'
          ,elem: '#timerange'
          ,range: ['#startDate', '#endDate']
        });
     /* 自定义验证规则 */
    form.verify({
      title: function(value){
        if(value.length < 1){
          return '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['nocontent'];?>
';
        }else if(value < 1){
          return '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
 <?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['product'];?>
';
        }
      }
      ,double: function(value){
        if(/^\d+$/.test(value)==false && /^\d+\.\d+$/.test(value)==false)
        {
            return '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['paraerror'];?>
';
        }
      }
      ,description: function(value) {
          return layedit.sync(description);
        }
    });

    form.on('select(brickType)', function(data) {
          var proname = $(data.elem).find("option:selected").attr("data-proname");
          $('input[name="title"]').val(proname);
    });

    form.on('radio(brickType)', function(data){
        var p = data.value;
        if( p == 1 ){
            $('.showfk').hide();
            $('.yunying').show();
            
        }else if( p == 2 ){
            $('.showfk').show();
            $('.yunying').hide();
        }
        form.render();
    });

    form.on('submit(delall)', function (data) {
          if(data.field.run==1){
            layer.alert('<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['conwarn'];?>
', {
                offset:'100px'
                , closeBtn: 1 // 是否显示关闭按钮
                , anim: 1 //动画类型
                , btn: ['<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['confirm'];?>
', '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['table']['cancel'];?>
'] //按钮
                , icon: 6 // icon
                , yes: function () {
                    $('#delall').attr("disabled",true);
                    $('#delall').addClass('layui-btn-disabled');
                    $.post('riskdel',data.field,function(res){
                        if(res.code == 200){
                            layer.msg(res.msg);
                            setTimeout(() => {
                                window.location.reload();
                                // xadmin.close();
                            }, 1000);
                        }else{
                          $('#delall').removeAttr("disabled");
                          $('#delall').removeClass('layui-btn-disabled');
                          layer.msg(res.msg);
                        }
                    })
                }
            });
          }else{
              $('#delall').attr("disabled",true);
              $('#delall').addClass('layui-btn-disabled');
              $.post('riskdel',data.field,function(res){
                  if(res.code == 200){
                      layer.msg(res.msg);
                      setTimeout(() => {
                          window.location.reload();
                          // xadmin.close();
                      }, 1000);
                  }else{
                      $('#delall').removeAttr("disabled");
                      $('#delall').removeClass('layui-btn-disabled');
                      layer.msg(res.msg);
                  }
            })
          }
        return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });
    
    form.on('submit(submit)', function (data) {
          $('#submit').attr("disabled",true);
          $('#submit').addClass('layui-btn-disabled');
              $.post('#',data.field,function(res){
                  if(res.code == 200){
                      layer.msg(res.msg);
                      setTimeout(() => {
                          window.parent.location.reload();
                          xadmin.close();
                      }, 1000);
                  }else{
                      $('#submit').removeAttr("disabled");
                      $('#submit').removeClass('layui-btn-disabled');
                      layer.msg(res.msg);
                  }
              })
        return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });
    //重置按钮，可以提交失败的时候再次提交
    $('#reset').click(function(){
        $('#submit').removeAttr("disabled");
        $('#submit').removeClass('layui-btn-disabled');
    });

    $('#checkuser').on('click', function(){
        var data = 'checkuser';
        layer.open({
          type: 2,
          title: '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
',
          offset: '50px', 
          closeBtn: 1, //要显示关闭按钮
          anim: 2,
          shadeClose: true, //开启遮罩
          // moveOut: true,
          area: ['1024px', '700px'],
          content: '/user/account/checklist/'
          ,resize:false
          ,maxmin: false //开启最大化最小化按钮
          ,success:function (layero, index) {
            var iframe = window['layui-layer-iframe'+index]; // 获取子页面的iframe
            iframe.child(data);// 向子页面的全局函数child传参
          }
        });
        window.ppp = function(value){
            if (value != "") {
                value = value.split("-")
                $('input[name="aid"]').val(value[0]); //将子页面传来的值赋值到指定输入框
                $('input[name="username"]').val(value[2]); //将子页面传来的值赋值到指定输入框
            }
        }
    })

    $('#checkoper').on('click', function(){
        var data = 'checkoper';
        layer.open({
          type: 2,
          title: '<?php echo $_smarty_tpl->tpl_vars['lang']->value['page']['public']['select'];?>
',
          offset: '50px', 
          closeBtn: 1, //要显示关闭按钮
          anim: 2,
          shadeClose: true, //开启遮罩
          // moveOut: true,
          area: ['1024px', '700px'],
          content: 'checklist'
          ,resize:false
          ,maxmin: false //开启最大化最小化按钮
          ,success:function (layero, index) {
            var iframe = window['layui-layer-iframe'+index]; // 获取子页面的iframe
            iframe.child(data);// 向子页面的全局函数child传参
          }
        });
        window.ppp = function(value){
            if (value != "") {
                value = value.split("-")
                $('input[name="relate"]').val(value[0]); //将子页面传来的值赋值到指定输入框
                $('input[name="conuts"]').val(value[1]); //将子页面传来的值赋值到指定输入框
                $('input[name="relatename"]').val(value[2]); //将子页面传来的值赋值到指定输入框
            }
        }
    })

  });

  <?php echo '</script'; ?>
>
</body>
</html>

<?php }
}
